﻿using LdtJudge.DataEngine.DataBaseStores;
using LdtJudge.DataEngine.Model.Collection;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;

namespace LdtDataEngin.Moudle
{
    public class MoudleDiscretionaryPlot : MoudleBase
    {
        private IMoudle _moudle;

        /// <summary>
        /// 裁量情节获取
        /// </summary>
        /// <param name="moudle">下一个模块</param>
        public MoudleDiscretionaryPlot(IMoudle moudle)
        {
            _moudle = moudle;
        }

        /// <summary>
        /// 裁量情节提取
        /// </summary>
        /// <param name="dataContext"></param>
        public override void MoudleHandle(DataContext dataContext)
        {
            string moudleName = typeof(MoudleAffordIllegalData).FullName;
            moudleName += "_" + this.GetHashCode();
            // 设置模块进度
            dataContext.InteractiveShow.ModuleProcessShow?.Invoke(moudleName, 0, dataContext.InteractiveShow.inputParameterModel);
            // 创建计时器
            Stopwatch stopwatch = new Stopwatch();
            stopwatch.Start();
            try
            {
               
            }
            catch (Exception ex)
            {
                dataContext.InteractiveShow.LogShow("裁量情节提取错误：" + ex.ToString(), LogMessageType.Error);
            }
            dataContext.InteractiveShow.LogShow("***************************" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "--->裁量情节提取模块执行完成*****************************");
            // 设置模块进度
            stopwatch.Stop();
            dataContext.InteractiveShow.ModuleProcessShow?.Invoke(moudleName + "_" + stopwatch.Elapsed.TotalMilliseconds.ToString("0"), 100, dataContext.InteractiveShow.inputParameterModel);
            //执行完毕调用下一个模块；
            _moudle.MoudleHandle(dataContext);
        }

        /// <summary>
        /// 模块处理结果
        /// </summary>
        /// <returns></returns>
        public static HandleResultModel MoudleHandleResult()
        {
            HandleResultModel resultModel = new HandleResultModel();
            return resultModel;
        }
    }
}
